import { BaseHelpProps } from '../../../functionalComponent';
import { IObject } from '../../../util';
import { OrgTreeType } from '../../org-tree';

export interface ICalcSubProjectBaseHelp extends BaseHelpProps {
  /**
   * @description       自定义弹出帮助的title
   */
  title?: string;
  /**
   * @description       是否显示组织树
   * @default           true
   */
  showTree?: boolean;
  /**
   * @description       表格列配置
   */
  columns?: IObject[];
  /**
   * @description 回填label，优先级低于labelField
   */
  displayField?: string;
  /**
   * @description       底部扩展组件
   */
  footer?: React.ReactNode;
  /**
   * @description       自定义用户请求
   */
  calcSubProjectRequest?: (params: any) => Promise<{ list: any[]; total: number | string }>;
  /**
   * @description 默认参数
   */
  calcSubProjectParams?: IObject[];
  /**
   * @description       传入工程项目的code
   */
  engineeringProjectCode?: string;
  /**
   * @description       是否开启多选模式
   * @default           false
   */
  multiple?: boolean;
  /**
   * @description       组织树的属性
   */
  treeProps?: OrgTreeType;
  // 下面三个属性兼容历史数据
  params?: OrgTreeType['params'];
  treeRequest?: OrgTreeType['treeRequest'];
  beforeRequest?: OrgTreeType['beforeRequest'];
}

export type ICalcSubProjectHelp = ICalcSubProjectBaseHelp & OrgTreeType;
